import { request } from 'ngfe-request'

// 获取当前汇率信息
export function getExcRate(params: any) {
  return request('/excRate', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'ExcRateMngSVC',
        stdIntfcInd: 'excRate',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}

// 修改扰动因子
export function excDisturbFactor(params: any) {
  return request('/updateDisturbFactor', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'ExcRateMngSVC',
        stdIntfcInd: 'updateDisturbFactor',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}


// 获取汇率列表
export function getExcRateList(params: any) {
  return request('/list', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'ExcRateMngSVC',
        stdIntfcInd: 'list',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}


// 生效当前汇率
export function activate(params: any) {
  console.log(params);
  return request('/activate', {
    method: 'POST',
    mode: 'cors',
    data: {
      sysHead: {
        stdSvcInd: 'ExcRateMngSVC',
        stdIntfcInd: 'activate',
        stdIntfcVerNo: '1.0.0',
        srcConsmSysInd: 'DAM',
      },
      body: {
        ...params,
      },
    },
  })
}